package org.msz.framework.web.service;

import org.msz.common.core.domain.entity.SysUser;
import org.msz.common.core.domain.model.LoginUser;
import org.msz.common.enums.UserStatus;
import org.msz.common.exception.ServiceException;
import org.msz.common.utils.StringUtils;
import org.msz.system.service.ISysUserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;

/**
 * 用户验证处理
 *
 * 
 */
@Service
public class UserDetailsServiceImpl implements UserDetailsService
{
    private static final Logger log = LoggerFactory.getLogger(UserDetailsServiceImpl.class);


    @Autowired
    private SysPermissionService permissionService;

    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException
    {
        //TODO 此处从·token获取用户信息，并从keycloak获取完整用户信息
        return createLoginUser();
    }

    public UserDetails createLoginUser()
    {
        return new LoginUser();
    }
}
